package com.Model;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.UI.R;

public class ClassEventAdapter extends ArrayAdapter<String> {

    private List<String> classEvents;

    public 	ClassEventAdapter(Context context, int textViewResourceId, List<String> records) {
            super(context, textViewResourceId, records);
            this.classEvents = records;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
            View classEventView = convertView;
            if (classEventView == null) {
                LayoutInflater classEventViewInflator = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

                classEventView = classEventViewInflator.inflate(R.layout.class_event_row, null);
            }
            String selection = classEvents.get(position);
            if (selection != null) {
                    TextView comboID = (TextView) classEventView.findViewById(R.id.eventComboID);
                    comboID.setTextAppearance( getContext(), R.style.SpecialText );
                    
                    if (comboID != null) {
                    	comboID.setText(selection);                            }

            }
            return classEventView;
    }
    
}     